package com.drm.netschool.mapper;

import com.drm.netschool.entity.DrmBuyOrder;
import com.drm.netschool.entity.DrmBuyOrderExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmBuyOrderMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int countByExample(DrmBuyOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int deleteByExample(DrmBuyOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    @Delete({
        "delete from drm_buy_order",
        "where order_id = #{orderId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String orderId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    @Insert({
        "insert into drm_buy_order (order_id, create_dt, ",
        "user_id, order_st, ",
        "commit_dt, confirm_dt, ",
        "pay_comfirm, pay_price, ",
        "pay_corn, pay_tp, ",
        "remark_desc, pay_discount, ",
        "trade_no)",
        "values (#{orderId,jdbcType=VARCHAR}, #{createDt,jdbcType=TIMESTAMP}, ",
        "#{userId,jdbcType=BIGINT}, #{orderSt,jdbcType=INTEGER}, ",
        "#{commitDt,jdbcType=TIMESTAMP}, #{confirmDt,jdbcType=TIMESTAMP}, ",
        "#{payComfirm,jdbcType=TIMESTAMP}, #{payPrice,jdbcType=INTEGER}, ",
        "#{payCorn,jdbcType=INTEGER}, #{payTp,jdbcType=INTEGER}, ",
        "#{remarkDesc,jdbcType=VARCHAR}, #{payDiscount,jdbcType=INTEGER}, ",
        "#{tradeNo,jdbcType=VARCHAR})"
    })
    int insert(DrmBuyOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int insertSelective(DrmBuyOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    List<DrmBuyOrder> selectByExample(DrmBuyOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    @Select({
        "select",
        "order_id, create_dt, user_id, order_st, commit_dt, confirm_dt, pay_comfirm, ",
        "pay_price, pay_corn, pay_tp, remark_desc, pay_discount, trade_no",
        "from drm_buy_order",
        "where order_id = #{orderId,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    DrmBuyOrder selectByPrimaryKey(String orderId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmBuyOrder record, @Param("example") DrmBuyOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int updateByExample(@Param("record") DrmBuyOrder record, @Param("example") DrmBuyOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int updateByPrimaryKeySelective(DrmBuyOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    @Update({
        "update drm_buy_order",
        "set create_dt = #{createDt,jdbcType=TIMESTAMP},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "order_st = #{orderSt,jdbcType=INTEGER},",
          "commit_dt = #{commitDt,jdbcType=TIMESTAMP},",
          "confirm_dt = #{confirmDt,jdbcType=TIMESTAMP},",
          "pay_comfirm = #{payComfirm,jdbcType=TIMESTAMP},",
          "pay_price = #{payPrice,jdbcType=INTEGER},",
          "pay_corn = #{payCorn,jdbcType=INTEGER},",
          "pay_tp = #{payTp,jdbcType=INTEGER},",
          "remark_desc = #{remarkDesc,jdbcType=VARCHAR},",
          "pay_discount = #{payDiscount,jdbcType=INTEGER},",
          "trade_no = #{tradeNo,jdbcType=VARCHAR}",
        "where order_id = #{orderId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(DrmBuyOrder record);
}